/*******************************************************************************
 * Copyright (c) 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package com.takaharabooks.mhp3rd;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.Cursor;
import android.database.SQLException;

public class DB_HuntingWhistle extends DB_Base
{
	//**********************定数定義**********************
	//***** 数値
	// Version
	// 2011/01/23	ver.1
	// 2011/01/25	ver.2
	// 2011/01/26	ver.3
	// 2011/01/31	ver.4
	public static final int DB_VER = 4;
	//***** 文字列
	// DB名
	public static final String	DB_NAME = "HuntingWhistle.db";
	// テーブル名
	public static final String	DB_WHISTLE_TBL_NAME = "tb_whistle";
	public static final String	DB_EFFECT_TBL_NAME = "tb_effect";
	public static final String	DB_MELODY_TBL_NAME = "tb_melody";
	public static final String	DB_HUNTING_WHISTLE_TBL_NAME = "tb_hunting_whistle";	
	// View名
	public static final String	DB_VIEW_NAME = "vw_hunting_whistle";
	// 列名
	public static final String	DB_COL_WHISTLE_ID = "whistle_id";
	public static final String	DB_COL_WHISTLE_MELODY = "whistle_melody";
	public static final String	DB_COL_EFFECT_ID = "effect_id";
	public static final String	DB_COL_EFFECT_DESC = "effect_desc";
	public static final String	DB_COL_EFFECT_DOUBLE = "effect_double";
	public static final String	DB_COL_MELODY_ID = "melody_id";
	public static final String	DB_COL_MELODY_DESC = "melody_desc";
	public static final String	DB_COL_MELODY_EFFECT_ID = "melody_effect_id";
	public static final String	DB_COL_MELODY_EFFECT_KIND = "melody_effect_KIND";
	public static final String	DB_COL_HUNTING_WHISTLE_ID = "hunting_whistle_id";
	public static final String	DB_COL_HUNTING_WHISTLE_MELODY_ID = "hunting_whistle_melody_id";
	//**********************定数定義**********************

    // 設定情報
    //public Preferences_Setting m_csSetting;
	
	private int m_nWhistle[];
	private String m_strWhistle[];
	private String m_strHuntingWhistle[][];
	private int m_nHuntingWhistle[];
		
	// コンストラクタ
	public DB_HuntingWhistle(Context context) {
		super(context, DB_NAME, DB_VER);
		m_csContext = context;
	}
	
	// ＤＢからデータ取得して内部でセット
	public boolean StartDB()
	{
		// 笛リストをセット
		SetDBForHuntingWhistle(0);
		SetDBForWhistle(0);
        
        return true;
	}
	
	// ＤＢをセットしなおします
	public boolean ResetDB(int nKind)
	{
		SetDBForHuntingWhistle(nKind);
		SetDBForWhistle(nKind);
		
		return true;
	}
	
	/*****************************************
	 *  絞込みのデータを取得
	 ****************************************/
    public boolean SetDBForWhistle(int nKind)
    {
		Cursor csCur;
		// ＤＢからデータの取得
		// 笛（♪♪♪）リストを取得
		try{
			String strQueryForWhere = String.format("where %s and %s ",
					DB_COL_WHISTLE_ID + " = " + DB_COL_HUNTING_WHISTLE_ID,
					DB_COL_HUNTING_WHISTLE_MELODY_ID + " = " + DB_COL_MELODY_ID
			);				
			if( IsEachKind(nKind) ){
				strQueryForWhere += String.format("and %s ",
						DB_COL_MELODY_EFFECT_KIND + " = " + nKind
				);				
			}
			String strQuery = String.format( "select Distinct %s, %s from %s, %s, %s " + strQueryForWhere,
					DB_COL_WHISTLE_ID,
					DB_COL_WHISTLE_MELODY,
					DB_WHISTLE_TBL_NAME,
					DB_HUNTING_WHISTLE_TBL_NAME,
					DB_MELODY_TBL_NAME					
			);
	    	csCur = readDB(strQuery);			
		}catch(Exception e){
			// 例外時は何もしない
			return false;
		}
		
		int nWhistleNum = csCur.getCount();
		m_nWhistle = new int[nWhistleNum];
		m_strWhistle = new String[nWhistleNum];
    	
    	// カーソルを使ってメンバ変数にデータをセット
        csCur.moveToFirst();
        for(int nIndex=0; nIndex<nWhistleNum; nIndex++){
        	m_nWhistle[nIndex] = csCur.getInt(0);
        	m_strWhistle[nIndex] = csCur.getString(1);
        	csCur.moveToNext();
        }
        csCur.close();

        return true;
    }

	/*****************************************
	 *  旋律効果別に絞込みを行っているかどうか
	 *  Return:	TRUE or FALSE
	 ****************************************/
    private boolean IsEachKind(int nKind){
    	return (0 < nKind);
    }
    
	/*****************************************
	 *  絞込みのデータを取得
	 ****************************************/
    public boolean SetDBForHuntingWhistle(int nKind)
    {
		Cursor csCur2;
		// ＤＢからデータの取得
		// 笛（♪♪♪）リストを取得
		try{
			String strQueryForWhere = String.format("where %s and %s",
					DB_COL_HUNTING_WHISTLE_MELODY_ID + " = " + DB_COL_MELODY_ID,
					DB_COL_MELODY_EFFECT_ID + " = " + DB_COL_EFFECT_ID
					);
			// もし旋律効果種別に絞込みを行うなら、ここで条件追加
			if( IsEachKind(nKind) ){
				strQueryForWhere += " and " + DB_COL_MELODY_EFFECT_KIND + " = " + nKind;	// 旋律効果種別
			}
			String strQuery = String.format( "select Distinct %s, %s, %s, %s from %s, %s, %s " + strQueryForWhere, 
					DB_COL_HUNTING_WHISTLE_ID,
					DB_COL_MELODY_DESC,
					DB_COL_EFFECT_DESC,
					DB_COL_EFFECT_DOUBLE,					
					DB_HUNTING_WHISTLE_TBL_NAME,
					DB_MELODY_TBL_NAME,
					DB_EFFECT_TBL_NAME
					);
	    	csCur2 = readDB(strQuery);			
		}catch(Exception e){
			// 例外時は何もしない
			return false;
		}
		
		int nHuntingWhistleNum = csCur2.getCount();
		m_strHuntingWhistle = new String[nHuntingWhistleNum][3];
		m_nHuntingWhistle = new int[nHuntingWhistleNum];
    	
    	// カーソルを使ってメンバ変数にデータをセット
        csCur2.moveToFirst();
        for(int nIndex=0; nIndex<nHuntingWhistleNum; nIndex++){
        	m_nHuntingWhistle[nIndex] = csCur2.getInt(0);
        	m_strHuntingWhistle[nIndex][0] = csCur2.getString(1);
        	m_strHuntingWhistle[nIndex][1] = csCur2.getString(2);
        	m_strHuntingWhistle[nIndex][2] = csCur2.getString(3);
        	csCur2.moveToNext();
        }
        csCur2.close();

        return true;
    }

	/*****************************************
	 *  データ数を取得
	 ****************************************/
    public int GetWhistleNum(){
    	return m_strWhistle.length;
    }
	
	/*****************************************
	 *  データ数を取得
	 ****************************************/
    public int GetHuntingWhistleNum(){
    	return m_nHuntingWhistle.length;
    }
	
	/*****************************************
	 *  笛（文字列）を取得
	 ****************************************/
	public String GetWhistleStr(int nIndex)
	{
		return m_strWhistle[nIndex];
	}

	/*****************************************
	 *  早見表（文字列）を取得
	 ****************************************/
	public String[][] GetHuntingWhistleStr(int nIndex)
	{
		int nNo = m_nWhistle[nIndex];
		int nNum = 0;
		
		// 該当する音符の配列を取得
		for(int nIdx=0; nIdx<m_nHuntingWhistle.length; nIdx++){
			if(m_nHuntingWhistle[nIdx] == nNo){
				nNum++;
			}
		}
		
		String[][] strRet = new String[nNum][3];
		
		// 該当する音符の配列を取得
		nNum = 0;
		for(int nIdx=0; nIdx<m_nHuntingWhistle.length; nIdx++){
			if(m_nHuntingWhistle[nIdx] == nNo){
				strRet[nNum][0] = m_strHuntingWhistle[nIdx][0];
				strRet[nNum][1] = m_strHuntingWhistle[nIdx][1];
				strRet[nNum][2] = m_strHuntingWhistle[nIdx][2];
				nNum++;
			}
		}

		return strRet;
	}

    //データベースオブジェクトを取得する（データベースにアクセスするとDBがない場合は作成される。）  
	public void InitDB(){
		InitDBBase();//DB_Base
		StartDB();
	}

	// @Override onCreate
	@Override
	public void onCreate(SQLiteDatabase db)
	{
		InitAllTbl(db);
    }

	// @Override onUpgrade
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{
		// いつでも？
		{
			DropAllTbl(db, oldVersion);
			InitAllTbl(db);
		}
		
		////////////////////////////
		// 全バージョン共通処理
		
		// イメージ情報更新
		//for(int nIndex=0; nIndex<m_stnImageIds.length; nIndex++){
		//	UpdateMonsterImage(db, nIndex, m_stnImageIds[nIndex]);
		//}
	}
	
	// ＤＢをすべて破棄します
	public void DropAllTbl(SQLiteDatabase db, int oldVersion)
	{
        String sql = "";  
        // 笛テーブル削除
        try {
	        sql += "drop table " + DB_WHISTLE_TBL_NAME;
	        db.execSQL(sql);
    	}catch(SQLException e){
    	}
        // 効果テーブル削除
    	sql = "";
        try {
	        sql += "drop table " + DB_EFFECT_TBL_NAME;
	        db.execSQL(sql);
    	}catch(SQLException e){
    	}
        // 旋律テーブル削除
    	sql = "";
        try {
	        sql += "drop table " + DB_MELODY_TBL_NAME;
	        db.execSQL(sql);
    	}catch(SQLException e){
    	}
        // 早見表テーブル削除
    	sql = "";
        try {
	        sql += "drop table " + DB_HUNTING_WHISTLE_TBL_NAME;
	        db.execSQL(sql);
    	}catch(SQLException e){
    	}
	}
	
	// ＤＢをすべて作成します
	public void InitAllTbl(SQLiteDatabase db)
	{
		CreateWhistleTbl(db);
		CreateEffectTbl(db);
		CreateMelodyTbl(db);
		CreateHuntingWhistleTbl(db);
	}
	
	/*****************************************
	 *  笛テーブルを作成
	 ****************************************/
	public void CreateWhistleTbl(SQLiteDatabase db)
	{
		// DBクリエイト
        String sql = String.format(
        		"create table %s (%s integer primary key, %s text not null)",
        		DB_WHISTLE_TBL_NAME,
        		DB_COL_WHISTLE_ID,
        		DB_COL_WHISTLE_MELODY);
        db.execSQL(sql);

        // データ挿入
        int nNo = 0;
        for(int nIndex=0; nIndex<m_stStrWhistle.length; nIndex++)
        {
        	nNo = nIndex+1;
        	sql = String.format(
        			"insert into %s values(%d, \'%s\')",
        			DB_WHISTLE_TBL_NAME,
        			nNo,
        			m_stStrWhistle[nIndex]);        			
            db.execSQL(sql);
        }
	}
	
	/*****************************************
	 *  効果テーブルを作成
	 ****************************************/
	public void CreateEffectTbl(SQLiteDatabase db)
	{
		// DBクリエイト
        String sql = String.format(
        		"create table %s (%s integer primary key, %s text not null, %s text not null)",
        		DB_EFFECT_TBL_NAME,
        		DB_COL_EFFECT_ID,
        		DB_COL_EFFECT_DESC,
        		DB_COL_EFFECT_DOUBLE);
        db.execSQL(sql);

        // データ挿入
        int nNo = 0;
        for(int nIndex=0; nIndex<m_stStrEffect.length; nIndex++)
        {
        	nNo = nIndex+1;
        	sql = String.format(
        			"insert into %s values(%d, \'%s\', \'%s\')",
        			DB_EFFECT_TBL_NAME,
        			nNo,
        			m_stStrEffect[nIndex][0],
        			m_stStrEffect[nIndex][1]);        			
            db.execSQL(sql);
        }
	}
	
	/*****************************************
	 *  旋律テーブルを作成
	 ****************************************/
	public void CreateMelodyTbl(SQLiteDatabase db)
	{
		// DBクリエイト
        String sql = String.format(
        		"create table %s (%s integer primary key, %s text not null, %s integer, %s integer)",
        		DB_MELODY_TBL_NAME,
        		DB_COL_MELODY_ID,
        		DB_COL_MELODY_DESC,
        		DB_COL_MELODY_EFFECT_ID,
        		DB_COL_MELODY_EFFECT_KIND);
        db.execSQL(sql);

        // データ挿入
        for(int nIndex=0; nIndex<m_stMelody.length; nIndex++)
        {
        	String strTemp = "";
        	strTemp += m_stO[m_stMelody[nIndex][0]];
        	strTemp += m_stO[m_stMelody[nIndex][1]];
        	strTemp += m_stO[m_stMelody[nIndex][2]];
        	strTemp += m_stO[m_stMelody[nIndex][3]];
        	
        	sql = String.format(
        			"insert into %s values(%d, \'%s\', %d, %d)",
        			DB_MELODY_TBL_NAME,
        			nIndex,
        			strTemp,
        			m_stMelody[nIndex][4],
        			m_stMelody[nIndex][5]);
            db.execSQL(sql);
        }
	}
	
	/*****************************************
	 *  早見表テーブルを作成
	 ****************************************/
	public void CreateHuntingWhistleTbl(SQLiteDatabase db)
	{
		// DBクリエイト
        String sql = String.format(
        		"create table %s (%s integer primary key, %s integer, %s integer)",
        		DB_HUNTING_WHISTLE_TBL_NAME,
        		"no",
        		DB_COL_HUNTING_WHISTLE_ID,
        		DB_COL_HUNTING_WHISTLE_MELODY_ID);
        db.execSQL(sql);

        // データ挿入
        int nNo = 0;
        for(int nIndex=0; nIndex<m_stnHuntingWhistle.length; nIndex++)
        {
        	nNo = nIndex+1;
        	sql = String.format(
        			"insert into %s values(%d, %d, %d)",
        			DB_HUNTING_WHISTLE_TBL_NAME,
        			nNo,
        			m_stnHuntingWhistle[nIndex][0],
        			m_stnHuntingWhistle[nIndex][1]);        			
            db.execSQL(sql);
        }
	}
	
	//////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////
	// ＤＢ上に入れるデフォルトの値
	
	// 音色
	private String[] m_stO = {
			" ",
			// 1:白
			"<font color=white>♪</font> ",
			// 2:紫
			"<font color=#ff80ff>♪</font> ",
			// 3:青
			"<font color=blue>♪</font> ",
			// 4:赤
			"<font color=red>♪</font> ",
			// 5:緑
			"<font color=#66ff00>♪</font> ",
			// 6:空
			"<font color=#00ccff>♪</font> ",
			// 7:黄
			"<font color=yellow>♪</font> ",
			// 8:橙
			"<font color=#ffc060>♪</font> "
	};
	
    private String[] m_stStrWhistle =
    {
    	// 1～10（白音色）
    		// 白青赤
            "<font color=white>♪</font> <font color=blue>♪</font> <font color=red>♪</font>",
    		// 白緑赤
            "<font color=white>♪</font> <font color=#66ff00>♪</font> <font color=red>♪</font>",
    		// 白空赤
            "<font color=white>♪</font> <font color=#00ccff>♪</font> <font color=red>♪</font>",
    		// 白赤黄
            "<font color=white>♪</font> <font color=red>♪</font> <font color=yellow>♪</font>",
    		// 白青緑
            "<font color=white>♪</font> <font color=blue>♪</font> <font color=#66ff00>♪</font>",
    		// 白青空
            "<font color=white>♪</font> <font color=blue>♪</font> <font color=#00ccff>♪</font>",
    		// 白青黄
            "<font color=white>♪</font> <font color=blue>♪</font> <font color=yellow>♪</font>",
    		// 白緑空
            "<font color=white>♪</font> <font color=#66ff00>♪</font> <font color=#00ccff>♪</font>",
    		// 白緑黄
            "<font color=white>♪</font> <font color=#66ff00>♪</font> <font color=yellow>♪</font>",
    		// 白空黄
            "<font color=white>♪</font> <font color=#00ccff>♪</font> <font color=yellow>♪</font>",
        // 11～25（紫音色）
    		// 紫赤橙
            "<font color=#ff44ff>♪</font> <font color=red>♪</font> <font color=#ff9944>♪</font>",
    		// 紫青橙
            "<font color=#ff44ff>♪</font> <font color=blue>♪</font> <font color=#ff9944>♪</font>",
    		// 紫空橙
            "<font color=#ff44ff>♪</font> <font color=#00ccff>♪</font> <font color=#ff9944>♪</font>",
    		// 紫赤青
            "<font color=#ff44ff>♪</font> <font color=red>♪</font> <font color=blue>♪</font>",
    		// 紫赤緑
            "<font color=#ff44ff>♪</font> <font color=red>♪</font> <font color=#66ff00>♪</font>",
    		// 紫赤空
            "<font color=#ff44ff>♪</font> <font color=red>♪</font> <font color=#00ccff>♪</font>",
    		// 紫赤黄
            "<font color=#ff44ff>♪</font> <font color=red>♪</font> <font color=yellow>♪</font>",
    		// 紫青緑
            "<font color=#ff44ff>♪</font> <font color=blue>♪</font> <font color=#66ff00>♪</font>",
    		// 紫青空
            "<font color=#ff44ff>♪</font> <font color=blue>♪</font> <font color=#00ccff>♪</font>",
    		// 紫黄青
            "<font color=#ff44ff>♪</font> <font color=yellow>♪</font> <font color=blue>♪</font>",
    		// 紫緑空
            "<font color=#ff44ff>♪</font> <font color=#66ff00>♪</font> <font color=#00ccff>♪</font>",
    		// 紫緑黄
            "<font color=#ff44ff>♪</font> <font color=#66ff00>♪</font> <font color=yellow>♪</font>",
    		// 紫空黄
            "<font color=#ff44ff>♪</font> <font color=#00ccff>♪</font> <font color=yellow>♪</font>",
    		// 紫緑橙
            "<font color=#ff44ff>♪</font> <font color=#66ff00>♪</font> <font color=#ff9944>♪</font>",
    		// 紫黄橙
            "<font color=#ff44ff>♪</font> <font color=yellow>♪</font> <font color=#ff9944>♪</font>"
    };
    
    // 効果リスト
    private String[][] m_stStrEffect = {
    		// 自己強化 1-4
    		{"自分の移動速度強化", "攻撃が弾かれなくなる"},	
    		{"千里眼", ""},	
    		{"高周波発生", ""},	
    		{"全旋律効果延長", ""},	
    		// 攻撃・防御・スタミナ等 5-12
    		{"攻撃力強化【小】", "さらに攻撃力強化"},	
    		{"攻撃力強化【大】", "さらに攻撃力強化"},	
    		{"防御力強化【小】", "さらに防御力強化"},	
    		{"防御力強化【大】", "さらに防御力強化"},	
    		{"攻撃力＆防御力強化【小】", ""},	
    		{"スタミナ減少無効【小】", ""},	
    		{"スタミナ減少無効【大】", ""},	
    		{"属性攻撃力強化", ""},	
    		// 体力回復 13-23
    		{"体力回復【小】", ""},	
    		{"体力回復【小】＆解毒", ""},	
    		{"体力回復【中】＆消臭", ""},	
    		{"体力回復【中】＆解毒", ""},	
    		{"体力回復【大】", ""},	
    		{"会心率ＵＰ＆体力回復【小】", ""},	
    		{"精霊王の加護", ""},	
    		{"回復速度【小】", ""},	
    		{"回復速度【大】", ""},	
    		{"体力増加【小】", ""},	
    		{"体力増加【大】", ""},
    		// 状態変化 24-37
    		{"風圧無効", "風圧完全無効"},
    		{"風圧完全無効", ""},
    		{"聴覚保護【小】", "聴覚保護【大】"},	
    		{"聴覚保護【大】", ""},	
    		{"聴覚保護【小】、風圧無効", "聴覚保護【大】、風圧完全無効"},	
    		{"暑さ無効", ""},	
    		{"寒さ無効", ""},	
    		{"耐雪＆耐泥", ""},	
    		{"耐震", ""},	
    		{"麻痺無効", ""},	
    		{"気絶無効", ""},	
    		{"全状態異常無効", ""},	
    		{"のけぞり無効", ""},	
    		{"属性やられ無効", ""},
    		// 耐性変化 38-50
    		{"火耐性強化【小】＆火やられ【小】無効", "さらに火耐性強化＆火やられ完全無効"},	
    		{"水耐性強化【小】＆水やられ【小】無効", "さらに水耐性強化＆水やられ完全無効"},	
    		{"氷耐性強化【小】＆氷やられ【小】無効", "さらに氷耐性強化＆氷やられ完全無効"},	
    		{"雷耐性強化【小】＆雷やられ【小】無効", "さらに雷耐性強化＆雷やられ完全無効"},	
    		{"龍耐性強化【小】", ""},	
    		{"火耐性強化【大】＆火やられ【大】無効", "さらに火耐性強化＆火やられ完全無効"},	
    		{"水耐性強化【大】＆水やられ【大】無効", "さらに水耐性強化＆水やられ完全無効"},	
    		{"氷耐性強化【大】＆氷やられ【大】無効", "さらに氷耐性強化＆氷やられ完全無効"},	
    		{"雷耐性強化【大】＆雷やられ【大】無効", "さらに雷耐性強化＆雷やられ完全無効"},	
    		{"龍耐性強化【大】", ""},	
    		{"全属性耐性強化", ""},
    		{"状態異常攻撃強化", ""}
    };
    
    // 旋律種別（現在未使用）
/*    private String[] m_stStrKind = {
    	"自己強化",
    	"能力強化",
    	"体力回復",
    	"状態変化",
    	"耐性変化"
    };
*/
    // 旋律リスト
    private int[][] m_stMelody = {
    		// 自己強化 1-4
    		{1,1,0,0, 1, 1},	//0
    		{2,2,0,0, 1, 1},	//1
    		{1,3,6,0, 2, 1},	//2
    		{7,7,7,0, 3, 1},	//3
    		{8,4,8,0, 4, 1},	//4
    		// 攻撃・防御・スタミナ等 5-12
    		{1,4,4,0, 5, 2},	//5
    		{2,4,7,0, 5, 2},	//6
    		{4,7,2,0, 5, 2},	//7
    		{7,2,4,0, 5, 2},	//8
    		{2,4,5,2, 6, 2},	//9
    		{2,4,6,2, 6, 2},	//10
    		{2,8,8,4, 6, 2},	//11
    		{1,3,3,0, 7, 2},	//12
    		{2,3,3,2, 8, 2},	//13
    		{8,3,2,3, 9, 2},	//14
    		{2,3,8,8, 9, 2},	//15
    		{1,5,3,0, 10, 2},	//16
    		{1,6,3,0, 10, 2},	//17
    		{1,7,3,0, 10, 2},	//18
    		{2,5,3,5, 11, 2},	//19
    		{2,6,3,6, 11, 2},	//20
    		{2,7,3,0, 11, 2},	//21
    		{2,8,3,8, 11, 2},	//22
    		{7,6,7,6, 12, 2},	//23
    		{2,5,7,5, 12, 2},	//24
    		{2,8,7,8, 12, 2},	//25
    		// 体力回復 13-23
    		{1,5,1,0, 13, 3},	//26
    		{5,3,1,3, 14, 3},	//27
    		{5,1,6,5, 15, 3},	//28
    		{5,3,2,3, 16, 3},	//29
    		{5,5,2,6, 17, 3},	//30
    		{5,8,2,8, 18, 3},	//31
    		{2,5,7,5, 19, 3},	//32
    		{2,8,2,6, 19, 3},	//33
    		{5,5,4,1, 20, 3},	//34
    		{5,5,7,0, 20, 3},	//35
    		{5,5,4,2, 21, 3},	//36
    		{4,3,1,0, 22, 3},	//37
    		{4,3,4,2, 23, 3},	//38
    		// 状態変化 24-37
    		{3,3,4,0, 24, 4},	//39
    		{3,3,5,0, 24, 4},	//40
    		{3,3,6,0, 24, 4},	//41
    		{3,3,7,2, 25, 4},	//42
    		{3,3,8,0, 25, 4},	//43
    		{6,6,4,1, 26, 4},	//44
    		{6,6,5,1, 26, 4},	//45
    		{6,6,4,2, 26, 4},	//46
    		{8,8,5,2, 27, 4},	//47
    		{6,6,5,2, 27, 4},	//48
    		{2,7,8,7, 28, 4},	//49
    		{4,4,6,0, 29, 4},	//50
    		{6,4,6,0, 30, 4},	//51
    		{6,6,6,0, 31, 4},	//52
    		{6,6,7,0, 32, 4},	//53
    		{6,7,1,0, 33, 4},	//54
    		{6,3,2,0, 34, 4},	//55
    		{6,2,8,8, 35, 4},	//56
    		{4,8,4,2, 36, 4},	//57
    		{8,7,7,8, 37, 4},	//58
    		// 耐性変化 38-49
    		{7,4,1,0, 38, 5},	//59
    		{7,6,1,0, 39, 5},	//60
    		{7,3,1,0, 40, 5},	//61
    		{7,5,1,0, 41, 5},	//62
    		{1,7,6,0, 42, 5},	//63
    		{7,4,2,0, 43, 5},	//64
    		{7,6,2,0, 44, 5},	//65
    		{7,3,2,0, 45, 5},	//66
    		{7,5,2,0, 46, 5},	//67
    		{2,7,6,0, 47, 5},	//68
    		{7,8,2,0, 48, 5},	//69
    		// 追加
    		{6,8,8,2, 49, 2},	//70
    		{2,4,3,2, 6, 2},	//71 追加ー攻撃力強化【大】
    		{2,5,2,0, 13, 3},	//72 追加ー体力回復【小】
    		{2,3,6,0, 2, 1},	//73 追加ー千里眼
    		{5,7,2,7, 19, 3},	//74 追加ー精霊王の加護
    		{6,7,2,0, 33, 4}	//75 追加ー麻痺無効
    };
    
    // 早見表リスト
    private int[][] m_stnHuntingWhistle = {
    		{1, 0},	
    		{1, 5},	
    		{1, 12},	
    		{1, 37},	
    		{1, 39},	
    		{2, 0},	
    		{2, 5},	
    		{2, 26},	
    		{2, 34},	
    		{3, 0},	
    		{3, 5},	
    		{3, 50},	
    		{3, 51},	
    		{3, 52},	
    		{3, 44},	
    		{4, 0},	
    		{4, 5},	
    		{4, 59},	
    		{4, 3},	
    		{5, 0},	
    		{5, 12},	
    		{5, 26},	
    		{5, 16},	
    		{5, 40},	
    		{5, 27},	
    		{6, 0},	
    		{6, 12},	
    		{6, 2},	
    		{6, 17},	
    		{6, 41},	
    		{6, 52},	
    		{7, 0},	
    		{7, 12},	
    		{7, 18},	
    		{7, 61},	
    		{7, 3},	
    		{8, 0},	
    		{8, 26},	
    		{8, 28},	
    		{8, 52},	
    		{8, 45},	
    		{9, 0},	
    		{9, 26},	
    		{9, 35},	
    		{9, 62},	
    		{9, 3},	
    		{10, 0},	
    		{10, 63},	
    		{10, 52},	
    		{10, 53},	
    		{10, 54},	
    		{10, 60},	
    		{10, 23},	
    		{10, 3},	
    		{11, 1},	
    		{11, 11},	
    		{11, 57},	
    		{11, 4},	
    		{12, 1},	
    		{12, 14},	
    		{12, 15},	
    		{12, 13},	
    		{12, 22},	
    		{12, 43},	
    		{13, 1},	
    		{13, 33},	
    		{13, 56},	
    		{13, 52},	
    		{13, 70},
    		{14, 1},	
    		{14, 71},	
    		{14, 13},	
    		{14, 38},	
    		{14, 39},	
    		{15, 1},	
    		{15, 9},	
    		{15, 72},	
    		{15, 36},	
    		{16, 1},	
    		{16, 10},	
    		{16, 50},	
    		{16, 51},	
    		{16, 46},	
    		{16, 52},	
    		{17, 1},	
    		{17, 6},	
    		{17, 7},	
    		{17, 8},	
    		{17, 64},	
    		{17, 3},	
    		{18, 1},	
    		{18, 13},	
    		{18, 72},	
    		{18, 19},	
    		{18, 40},	
    		{18, 29},	
    		{19, 1},	
    		{19, 13},	
    		{19, 73},	
    		{19, 20},	
    		{19, 41},	
    		{19, 55},	
    		{19, 52},	
    		{20, 1},	
    		{20, 13},	
    		{20, 21},	
    		{20, 42},	
    		{20, 66},	
    		{20, 3},	
    		{21, 1},	
    		{21, 72},	
    		{21, 30},	
    		{21, 48},	
    		{21, 52},	
    		{22, 1},	
    		{22, 72},	
    		{22, 24},	
    		{22, 74},	
    		{22, 35},	
    		{22, 67},	
    		{22, 3},	
    		{23, 1},	
    		{23, 68},	
    		{23, 65},	
    		{23, 23},	
    		{23, 3},	
    		{23, 52},	
    		{23, 53},	
    		{23, 75},	
    		{24, 1},	
    		{24, 72},	
    		{24, 31},	
    		{24, 47},	
    		{25, 1},	
    		{25, 49},	
    		{25, 25},	
    		{25, 3},	
    		{25, 69},	
    		{25, 58}
    };
}